<?php 
//管理员的添加
	include_once("./com.php");
	$rem="select * from admin";
	$ser=mysql_query($rem);
	if(isset($_GET['sub'])){
		 $aname=$_GET['aname'];
		 $pwd=$_GET['pwd'];
		 $atype=$_GET['atype'];
		 $phone=$_GET['phone'];
		 $ins="insert into admin(aname,apassword,atype,phone,time)values('$aname','$pwd','$atype','$phone',now())";
		mysql_query($ins);
		if(mysql_affected_rows()>0){
			echo"<script>
					alert('添加成功')
					location.href='adm.php'
					</script>";
		}else {
			echo"<script>
					alert('添加失败')
					location.href='adm1.php'
					</script>";
				
			
		}
	};

 ?>
 <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理员</title>
<base target="_self">
<link rel="stylesheet" type="text/css" href="skin/css/base.css" />
<link rel="stylesheet" type="text/css" href="skin/css/main.css" />
</head>
<body leftmargin="8" topmargin='8'>
<table width="98%" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px;margin-top:8px;">
  <tr>
    <td background="skin/images/frame/wbg.gif" bgcolor="#EEF4EA" class='title' colspan="2"><span><img src='skin/images/frame/arr3.gif' style='margin-right:10px;'>添加管理员</span></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>
		<table style="margin-bottom:8px;margin-top:8px;margin-left:20px;">
			<form action="" method="" >
			 <tr>
				<td>用户名：</td><td><input type="text" name="aname" value=""></td>	
			 </tr>
			 <tr>
				<td>密码：</td><td><input type="password" name="pwd" value=""></td>	
			 </tr>
			  <tr>
				 <td>联系方式:</td><td><input type="text" name="phone" value=""></td>
			</tr>
			 <tr>
			 	<td>角色：</td>
			 	<td colspan="2" align="center">
				<select name="atype">
				   <option value=0>超级管理员</option>
				   <option value=1>一级管理员</option>
				   <option value=2>二级管理员</option>
				   <option value=3>三级管理员</option>
				</select>
				</td>
			</tr>
			
			 <tr>
				 	<td colspan="2" align="center" height="40px">
				 	<input type="submit" name="sub" value=" 添加 " class="coolbt2"></td>
			 </tr>
			</form>
		</table>
	</td>
  </tr>
</table>
</body>
</html>